<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<title>在线考试系统</title>
<%@include file="../common/include-header.jsp" %>
<link href="/static/css/reviewExam2.css" rel="stylesheet">
<body class="gray-bg">
<div id="box">
        <div id="questions">
            <c:forEach items="${examDetails}" var="examDetail" varStatus="vs">
<%--                <c:set var="type" value="${question.typeId == 10000 ? 'radio' : 'checkbox'}"> </c:set>--%>
                <div class="question">
                    <a name="no${vs.index+1}"></a>
                    <input type="hidden" class="yourAnswer" name="answer" value="${examDetail.yourAnswer}">
                    <input type="hidden" class="questionId" value="${examDetail.id}">
                    <input type="hidden" class="answer" value="${examDetail.question.answer}">
                    <div class="questionTop">
                        <div class="title">
                            <span>${examDetail.question.question}</span> <br>
                            <c:if test="${examDetail.question.typeId == 10000}">(单选)</c:if>
                            <c:if test="${examDetail.question.typeId == 10001}">(多选)</c:if>
                        </div>
                        <div class="${examDetail.question.answer == examDetail.yourAnswer?"img notSelectedDiv":"img errorSelectedDiv"}"></div>
                        <h3>${vs.index+1}</h3>
                    </div>
                    <ul class="questionBottom">
                        <li>
                            <span>A:${examDetail.question.optionA}</span>
                        </li>
                        <li>
                            <span>B:${examDetail.question.optionB}</span>
                        </li>
                        <li>
                            <span>C:${examDetail.question.optionC}</span>
                        </li>
                        <li>
                            <span>D:${examDetail.question.optionD}</span>
                        </li>
                        <li>
                            <hr/>
                            正确答案是<span style="color:green">${examDetail.question.answer}</span>;
                            <c:if test="${examDetail.yourAnswer!=null&&examDetail.yourAnswer!=''}">您选择的是<span style="${examDetail.question.answer == examDetail.yourAnswer?"color:green":"color:red"}">${examDetail.yourAnswer}<span></c:if>
                            <c:if test="${examDetail.question.answer == examDetail.yourAnswer}"><span style="color:green">回答正确</span></c:if>
                            <c:if test="${examDetail.question.answer != examDetail.yourAnswer&&examDetail.yourAnswer!=null&&examDetail.yourAnswer!=''}"><span style="color:red">回答错误</span></c:if>
                            <c:if test="${examDetail.yourAnswer==null||examDetail.yourAnswer==''}"><span style="color:palevioletred">你没有回答此题</span></c:if>
                        </li>
                    </ul>
                </div>
            </c:forEach>
        </div>
    </div>
</div>
<%@include file="../common/include-footer.jsp" %>
<script src="/static/plugin/select/select2.js"></script>
<script>
    $(function () {
    })

</script>
</body>
</html>
